define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'user.address/index',
        add_url: 'user.address/add',
        edit_url: 'user.address/edit',
        delete_url: 'user.address/delete',
        export_url: 'user.address/export',
        modify_url: 'user.address/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar:['refresh','add','delete'],
                cols: [[
                    {type: 'checkbox'},                    {field: 'id', title: 'id'},                    {field: 'user_id', title: '用户ID'},                    {field: 'name', title: '收货人'},                    {field: 'phone', title: '联系电话'},                    {field: 'is_default', title: '0:非默认  1::默认'},                    {field: 'create_time', title: '添加时间'},                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
				done: function (){
                    $(".layui-table-body>table>tbody>tr").each(function (index, val) {
                        $($(".layui-table-fixed .layui-table-body table tr")[index]).height($(val).height());
                    });
                },
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});